<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>element.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="closure_goog_graphics_ext_element.js.html">element.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2007 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>/**
<a name="line16"></a> * @fileoverview A thicker wrapper around the DOM element returned from
<a name="line17"></a> * the different draw methods of the graphics implementation, and
<a name="line18"></a> * all interfaces that the various element types support.
<a name="line19"></a> * @author robbyw@google.com (Robby Walker)
<a name="line20"></a> */
<a name="line21"></a>
<a name="line22"></a>goog.provide(&#39;goog.graphics.ext.Element&#39;);
<a name="line23"></a>
<a name="line24"></a>goog.require(&#39;goog.events&#39;);
<a name="line25"></a>goog.require(&#39;goog.events.EventTarget&#39;);
<a name="line26"></a>goog.require(&#39;goog.functions&#39;);
<a name="line27"></a>goog.require(&#39;goog.graphics&#39;);
<a name="line28"></a>goog.require(&#39;goog.graphics.ext.coordinates&#39;);
<a name="line29"></a>
<a name="line30"></a>
<a name="line31"></a>
<a name="line32"></a>/**
<a name="line33"></a> * Base class for a wrapper around the goog.graphics wrapper that enables
<a name="line34"></a> * more advanced functionality.
<a name="line35"></a> * @param {goog.graphics.ext.Group?} group Parent for this element.
<a name="line36"></a> * @param {goog.graphics.Element} wrapper The thin wrapper to wrap.
<a name="line37"></a> * @constructor
<a name="line38"></a> * @extends {goog.events.EventTarget}
<a name="line39"></a> */
<a name="line40"></a>goog.graphics.ext.Element = function(group, wrapper) {
<a name="line41"></a>  goog.events.EventTarget.call(this);
<a name="line42"></a>  this.wrapper_ = wrapper;
<a name="line43"></a>  this.graphics_ = group ? group.getGraphics() : this;
<a name="line44"></a>
<a name="line45"></a>  this.xPosition_ = new goog.graphics.ext.Element.Position_(this, true);
<a name="line46"></a>  this.yPosition_ = new goog.graphics.ext.Element.Position_(this, false);
<a name="line47"></a>
<a name="line48"></a>  // Handle parent / child relationships.
<a name="line49"></a>  if (group) {
<a name="line50"></a>    this.parent_ = group;
<a name="line51"></a>    this.parent_.addChild(this);
<a name="line52"></a>  }
<a name="line53"></a>};
<a name="line54"></a>goog.inherits(goog.graphics.ext.Element, goog.events.EventTarget);
<a name="line55"></a>
<a name="line56"></a>
<a name="line57"></a>/**
<a name="line58"></a> * The graphics object that contains this element.
<a name="line59"></a> * @type {goog.graphics.ext.Graphics|goog.graphics.ext.Element}
<a name="line60"></a> * @private
<a name="line61"></a> */
<a name="line62"></a>goog.graphics.ext.Element.prototype.graphics_;
<a name="line63"></a>
<a name="line64"></a>
<a name="line65"></a>/**
<a name="line66"></a> * The goog.graphics wrapper this class wraps.
<a name="line67"></a> * @type {goog.graphics.Element}
<a name="line68"></a> * @private
<a name="line69"></a> */
<a name="line70"></a>goog.graphics.ext.Element.prototype.wrapper_;
<a name="line71"></a>
<a name="line72"></a>
<a name="line73"></a>/**
<a name="line74"></a> * The group or surface containing this element.
<a name="line75"></a> * @type {goog.graphics.ext.Group|undefined}
<a name="line76"></a> * @private
<a name="line77"></a> */
<a name="line78"></a>goog.graphics.ext.Element.prototype.parent_;
<a name="line79"></a>
<a name="line80"></a>
<a name="line81"></a>/**
<a name="line82"></a> * Whether or not computation of this element&#39;s position or size depends on its
<a name="line83"></a> * parent&#39;s size.
<a name="line84"></a> * @type {boolean}
<a name="line85"></a> * @private
<a name="line86"></a> */
<a name="line87"></a>goog.graphics.ext.Element.prototype.parentDependent_ = false;
<a name="line88"></a>
<a name="line89"></a>
<a name="line90"></a>/**
<a name="line91"></a> * Whether the element has pending transformations.
<a name="line92"></a> * @type {boolean}
<a name="line93"></a> * @private
<a name="line94"></a> */
<a name="line95"></a>goog.graphics.ext.Element.prototype.needsTransform_ = false;
<a name="line96"></a>
<a name="line97"></a>
<a name="line98"></a>/**
<a name="line99"></a> * The current angle of rotation, expressed in degrees.
<a name="line100"></a> * @type {number}
<a name="line101"></a> * @private
<a name="line102"></a> */
<a name="line103"></a>goog.graphics.ext.Element.prototype.rotation_ = 0;
<a name="line104"></a>
<a name="line105"></a>
<a name="line106"></a>/**
<a name="line107"></a> * Object representing the x position and size of the element.
<a name="line108"></a> * @type {goog.graphics.ext.Element.Position_}
<a name="line109"></a> * @private
<a name="line110"></a> */
<a name="line111"></a>goog.graphics.ext.Element.prototype.xPosition_;
<a name="line112"></a>
<a name="line113"></a>
<a name="line114"></a>/**
<a name="line115"></a> * Object representing the y position and size of the element.
<a name="line116"></a> * @type {goog.graphics.ext.Element.Position_}
<a name="line117"></a> * @private
<a name="line118"></a> */
<a name="line119"></a>goog.graphics.ext.Element.prototype.yPosition_;
<a name="line120"></a>
<a name="line121"></a>
<a name="line122"></a>/**
<a name="line123"></a> * @return {goog.graphics.Element} The underlying thin wrapper.
<a name="line124"></a> * @protected
<a name="line125"></a> */
<a name="line126"></a>goog.graphics.ext.Element.prototype.getWrapper = function() {
<a name="line127"></a>  return this.wrapper_;
<a name="line128"></a>};
<a name="line129"></a>
<a name="line130"></a>
<a name="line131"></a>/**
<a name="line132"></a> * @return {goog.graphics.ext.Element|goog.graphics.ext.Graphics} The graphics
<a name="line133"></a> *     surface the element is a part of.
<a name="line134"></a> */
<a name="line135"></a>goog.graphics.ext.Element.prototype.getGraphics = function() {
<a name="line136"></a>  return this.graphics_;
<a name="line137"></a>};
<a name="line138"></a>
<a name="line139"></a>
<a name="line140"></a>/**
<a name="line141"></a> * Returns the graphics implementation.
<a name="line142"></a> * @return {goog.graphics.AbstractGraphics} The underlying graphics
<a name="line143"></a> *     implementation drawing this element&#39;s wrapper.
<a name="line144"></a> * @protected
<a name="line145"></a> */
<a name="line146"></a>goog.graphics.ext.Element.prototype.getGraphicsImplementation = function() {
<a name="line147"></a>  return this.graphics_.getImplementation();
<a name="line148"></a>};
<a name="line149"></a>
<a name="line150"></a>
<a name="line151"></a>/**
<a name="line152"></a> * @return {goog.graphics.ext.Group|undefined} The parent of this element.
<a name="line153"></a> */
<a name="line154"></a>goog.graphics.ext.Element.prototype.getParent = function() {
<a name="line155"></a>  return this.parent_;
<a name="line156"></a>};
<a name="line157"></a>
<a name="line158"></a>
<a name="line159"></a>// GENERAL POSITIONING
<a name="line160"></a>
<a name="line161"></a>
<a name="line162"></a>/**
<a name="line163"></a> * Internal convenience method for setting position - either as a left/top,
<a name="line164"></a> * center/middle, or right/bottom value.  Only one should be specified.
<a name="line165"></a> * @param {goog.graphics.ext.Element.Position_} position The position object to
<a name="line166"></a> *     set the value on.
<a name="line167"></a> * @param {number|string} value The value of the coordinate.
<a name="line168"></a> * @param {goog.graphics.ext.Element.PositionType_} type The type of the
<a name="line169"></a> *     coordinate.
<a name="line170"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line171"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line172"></a> *     pending but not yet performed.
<a name="line173"></a> * @private
<a name="line174"></a> */
<a name="line175"></a>goog.graphics.ext.Element.prototype.setPosition_ = function(position, value,
<a name="line176"></a>    type, opt_chain) {
<a name="line177"></a>  position.setPosition(value, type);
<a name="line178"></a>  this.computeIsParentDependent_(position);
<a name="line179"></a>
<a name="line180"></a>  this.needsTransform_ = true;
<a name="line181"></a>  if (!opt_chain) {
<a name="line182"></a>    this.transform();
<a name="line183"></a>  }
<a name="line184"></a>};
<a name="line185"></a>
<a name="line186"></a>
<a name="line187"></a>/**
<a name="line188"></a> * Sets the width/height of the element.
<a name="line189"></a> * @param {goog.graphics.ext.Element.Position_} position The position object to
<a name="line190"></a> *     set the value on.
<a name="line191"></a> * @param {string|number} size The new width/height value.
<a name="line192"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line193"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line194"></a> *     pending but not yet performed.
<a name="line195"></a> * @private
<a name="line196"></a> */
<a name="line197"></a>goog.graphics.ext.Element.prototype.setSize_ = function(position, size,
<a name="line198"></a>    opt_chain) {
<a name="line199"></a>  if (position.setSize(size)) {
<a name="line200"></a>    this.needsTransform_ = true;
<a name="line201"></a>
<a name="line202"></a>    this.computeIsParentDependent_(position);
<a name="line203"></a>
<a name="line204"></a>    if (!opt_chain) {
<a name="line205"></a>      this.reset();
<a name="line206"></a>    }
<a name="line207"></a>  } else if (!opt_chain &amp;&amp; this.isPendingTransform()) {
<a name="line208"></a>    this.reset();
<a name="line209"></a>  }
<a name="line210"></a>};
<a name="line211"></a>
<a name="line212"></a>
<a name="line213"></a>/**
<a name="line214"></a> * Sets the minimum width/height of the element.
<a name="line215"></a> * @param {goog.graphics.ext.Element.Position_} position The position object to
<a name="line216"></a> *     set the value on.
<a name="line217"></a> * @param {string|number} minSize The minimum width/height of the element.
<a name="line218"></a> * @private
<a name="line219"></a> */
<a name="line220"></a>goog.graphics.ext.Element.prototype.setMinSize_ = function(position, minSize) {
<a name="line221"></a>  position.setMinSize(minSize);
<a name="line222"></a>  this.needsTransform_ = true;
<a name="line223"></a>  this.computeIsParentDependent_(position);
<a name="line224"></a>};
<a name="line225"></a>
<a name="line226"></a>
<a name="line227"></a>// HORIZONTAL POSITIONING
<a name="line228"></a>
<a name="line229"></a>
<a name="line230"></a>/**
<a name="line231"></a> * @return {number} The distance from the left edge of this element to the left
<a name="line232"></a> *     edge of its parent, specified in units of the parent&#39;s coordinate system.
<a name="line233"></a> */
<a name="line234"></a>goog.graphics.ext.Element.prototype.getLeft = function() {
<a name="line235"></a>  return this.xPosition_.getStart();
<a name="line236"></a>};
<a name="line237"></a>
<a name="line238"></a>
<a name="line239"></a>/**
<a name="line240"></a> * Sets the left coordinate of the element.  Overwrites any previous value of
<a name="line241"></a> * left, center, or right for this element.
<a name="line242"></a> * @param {string|number} left The left coordinate.
<a name="line243"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line244"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line245"></a> *     pending but not yet performed.
<a name="line246"></a> */
<a name="line247"></a>goog.graphics.ext.Element.prototype.setLeft = function(left, opt_chain) {
<a name="line248"></a>  this.setPosition_(this.xPosition_,
<a name="line249"></a>      left,
<a name="line250"></a>      goog.graphics.ext.Element.PositionType_.START,
<a name="line251"></a>      opt_chain);
<a name="line252"></a>};
<a name="line253"></a>
<a name="line254"></a>
<a name="line255"></a>/**
<a name="line256"></a> * @return {number} The right coordinate of the element, in units of the
<a name="line257"></a> *     parent&#39;s coordinate system.
<a name="line258"></a> */
<a name="line259"></a>goog.graphics.ext.Element.prototype.getRight = function() {
<a name="line260"></a>  return this.xPosition_.getEnd();
<a name="line261"></a>};
<a name="line262"></a>
<a name="line263"></a>
<a name="line264"></a>/**
<a name="line265"></a> * Sets the right coordinate of the element.  Overwrites any previous value of
<a name="line266"></a> * left, center, or right for this element.
<a name="line267"></a> * @param {string|number} right The right coordinate.
<a name="line268"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line269"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line270"></a> *     pending but not yet performed.
<a name="line271"></a> */
<a name="line272"></a>goog.graphics.ext.Element.prototype.setRight = function(right, opt_chain) {
<a name="line273"></a>  this.setPosition_(this.xPosition_,
<a name="line274"></a>      right,
<a name="line275"></a>      goog.graphics.ext.Element.PositionType_.END,
<a name="line276"></a>      opt_chain);
<a name="line277"></a>};
<a name="line278"></a>
<a name="line279"></a>
<a name="line280"></a>/**
<a name="line281"></a> * @return {number} The center coordinate of the element, in units of the
<a name="line282"></a> * parent&#39;s coordinate system.
<a name="line283"></a> */
<a name="line284"></a>goog.graphics.ext.Element.prototype.getCenter = function() {
<a name="line285"></a>  return this.xPosition_.getMiddle();
<a name="line286"></a>};
<a name="line287"></a>
<a name="line288"></a>
<a name="line289"></a>/**
<a name="line290"></a> * Sets the center coordinate of the element.  Overwrites any previous value of
<a name="line291"></a> * left, center, or right for this element.
<a name="line292"></a> * @param {string|number} center The center coordinate.
<a name="line293"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line294"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line295"></a> *     pending but not yet performed.
<a name="line296"></a> */
<a name="line297"></a>goog.graphics.ext.Element.prototype.setCenter = function(center, opt_chain) {
<a name="line298"></a>  this.setPosition_(this.xPosition_,
<a name="line299"></a>      center,
<a name="line300"></a>      goog.graphics.ext.Element.PositionType_.MIDDLE,
<a name="line301"></a>      opt_chain);
<a name="line302"></a>};
<a name="line303"></a>
<a name="line304"></a>
<a name="line305"></a>// VERTICAL POSITIONING
<a name="line306"></a>
<a name="line307"></a>
<a name="line308"></a>/**
<a name="line309"></a> * @return {number} The distance from the top edge of this element to the top
<a name="line310"></a> *     edge of its parent, specified in units of the parent&#39;s coordinate system.
<a name="line311"></a> */
<a name="line312"></a>goog.graphics.ext.Element.prototype.getTop = function() {
<a name="line313"></a>  return this.yPosition_.getStart();
<a name="line314"></a>};
<a name="line315"></a>
<a name="line316"></a>
<a name="line317"></a>/**
<a name="line318"></a> * Sets the top coordinate of the element.  Overwrites any previous value of
<a name="line319"></a> * top, middle, or bottom for this element.
<a name="line320"></a> * @param {string|number} top The top coordinate.
<a name="line321"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line322"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line323"></a> *     pending but not yet performed.
<a name="line324"></a> */
<a name="line325"></a>goog.graphics.ext.Element.prototype.setTop = function(top, opt_chain) {
<a name="line326"></a>  this.setPosition_(this.yPosition_,
<a name="line327"></a>      top,
<a name="line328"></a>      goog.graphics.ext.Element.PositionType_.START,
<a name="line329"></a>      opt_chain);
<a name="line330"></a>};
<a name="line331"></a>
<a name="line332"></a>
<a name="line333"></a>/**
<a name="line334"></a> * @return {number} The bottom coordinate of the element, in units of the
<a name="line335"></a> *     parent&#39;s coordinate system.
<a name="line336"></a> */
<a name="line337"></a>goog.graphics.ext.Element.prototype.getBottom = function() {
<a name="line338"></a>  return this.yPosition_.getEnd();
<a name="line339"></a>};
<a name="line340"></a>
<a name="line341"></a>
<a name="line342"></a>/**
<a name="line343"></a> * Sets the bottom coordinate of the element.  Overwrites any previous value of
<a name="line344"></a> * top, middle, or bottom for this element.
<a name="line345"></a> * @param {string|number} bottom The bottom coordinate.
<a name="line346"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line347"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line348"></a> *     pending but not yet performed.
<a name="line349"></a> */
<a name="line350"></a>goog.graphics.ext.Element.prototype.setBottom = function(bottom, opt_chain) {
<a name="line351"></a>  this.setPosition_(this.yPosition_,
<a name="line352"></a>      bottom,
<a name="line353"></a>      goog.graphics.ext.Element.PositionType_.END,
<a name="line354"></a>      opt_chain);
<a name="line355"></a>};
<a name="line356"></a>
<a name="line357"></a>
<a name="line358"></a>/**
<a name="line359"></a> * @return {number} The middle coordinate of the element, in units of the
<a name="line360"></a> *     parent&#39;s coordinate system.
<a name="line361"></a> */
<a name="line362"></a>goog.graphics.ext.Element.prototype.getMiddle = function() {
<a name="line363"></a>  return this.yPosition_.getMiddle();
<a name="line364"></a>};
<a name="line365"></a>
<a name="line366"></a>
<a name="line367"></a>/**
<a name="line368"></a> * Sets the middle coordinate of the element.  Overwrites any previous value of
<a name="line369"></a> * top, middle, or bottom for this element
<a name="line370"></a> * @param {string|number} middle The middle coordinate.
<a name="line371"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line372"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line373"></a> *     pending but not yet performed.
<a name="line374"></a> */
<a name="line375"></a>goog.graphics.ext.Element.prototype.setMiddle = function(middle, opt_chain) {
<a name="line376"></a>  this.setPosition_(this.yPosition_,
<a name="line377"></a>      middle,
<a name="line378"></a>      goog.graphics.ext.Element.PositionType_.MIDDLE,
<a name="line379"></a>      opt_chain);
<a name="line380"></a>};
<a name="line381"></a>
<a name="line382"></a>
<a name="line383"></a>// DIMENSIONS
<a name="line384"></a>
<a name="line385"></a>
<a name="line386"></a>/**
<a name="line387"></a> * @return {number} The width of the element, in units of the parent&#39;s
<a name="line388"></a> *     coordinate system.
<a name="line389"></a> */
<a name="line390"></a>goog.graphics.ext.Element.prototype.getWidth = function() {
<a name="line391"></a>  return this.xPosition_.getSize();
<a name="line392"></a>};
<a name="line393"></a>
<a name="line394"></a>
<a name="line395"></a>/**
<a name="line396"></a> * Sets the width of the element.
<a name="line397"></a> * @param {string|number} width The new width value.
<a name="line398"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line399"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line400"></a> *     pending but not yet performed.
<a name="line401"></a> */
<a name="line402"></a>goog.graphics.ext.Element.prototype.setWidth = function(width, opt_chain) {
<a name="line403"></a>  this.setSize_(this.xPosition_, width, opt_chain);
<a name="line404"></a>};
<a name="line405"></a>
<a name="line406"></a>
<a name="line407"></a>/**
<a name="line408"></a> * @return {number} The minimum width of the element, in units of the parent&#39;s
<a name="line409"></a> *     coordinate system.
<a name="line410"></a> */
<a name="line411"></a>goog.graphics.ext.Element.prototype.getMinWidth = function() {
<a name="line412"></a>  return this.xPosition_.getMinSize();
<a name="line413"></a>};
<a name="line414"></a>
<a name="line415"></a>
<a name="line416"></a>/**
<a name="line417"></a> * Sets the minimum width of the element.
<a name="line418"></a> * @param {string|number} minWidth The minimum width of the element.
<a name="line419"></a> */
<a name="line420"></a>goog.graphics.ext.Element.prototype.setMinWidth = function(minWidth) {
<a name="line421"></a>  this.setMinSize_(this.xPosition_, minWidth);
<a name="line422"></a>};
<a name="line423"></a>
<a name="line424"></a>
<a name="line425"></a>/**
<a name="line426"></a> * @return {number} The height of the element, in units of the parent&#39;s
<a name="line427"></a> *     coordinate system.
<a name="line428"></a> */
<a name="line429"></a>goog.graphics.ext.Element.prototype.getHeight = function() {
<a name="line430"></a>  return this.yPosition_.getSize();
<a name="line431"></a>};
<a name="line432"></a>
<a name="line433"></a>
<a name="line434"></a>/**
<a name="line435"></a> * Sets the height of the element.
<a name="line436"></a> * @param {string|number} height The new height value.
<a name="line437"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line438"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line439"></a> *     pending but not yet performed.
<a name="line440"></a> */
<a name="line441"></a>goog.graphics.ext.Element.prototype.setHeight = function(height, opt_chain) {
<a name="line442"></a>  this.setSize_(this.yPosition_, height, opt_chain);
<a name="line443"></a>};
<a name="line444"></a>
<a name="line445"></a>
<a name="line446"></a>/**
<a name="line447"></a> * @return {number} The minimum height of the element, in units of the parent&#39;s
<a name="line448"></a> *     coordinate system.
<a name="line449"></a> */
<a name="line450"></a>goog.graphics.ext.Element.prototype.getMinHeight = function() {
<a name="line451"></a>  return this.yPosition_.getMinSize();
<a name="line452"></a>};
<a name="line453"></a>
<a name="line454"></a>
<a name="line455"></a>/**
<a name="line456"></a> * Sets the minimum height of the element.
<a name="line457"></a> * @param {string|number} minHeight The minimum height of the element.
<a name="line458"></a> */
<a name="line459"></a>goog.graphics.ext.Element.prototype.setMinHeight = function(minHeight) {
<a name="line460"></a>  this.setMinSize_(this.yPosition_, minHeight);
<a name="line461"></a>};
<a name="line462"></a>
<a name="line463"></a>
<a name="line464"></a>// BOUNDS SHORTCUTS
<a name="line465"></a>
<a name="line466"></a>
<a name="line467"></a>/**
<a name="line468"></a> * Shortcut for setting the left and top position.
<a name="line469"></a> * @param {string|number} left The left coordinate.
<a name="line470"></a> * @param {string|number} top The top coordinate.
<a name="line471"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line472"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line473"></a> *     pending but not yet performed.
<a name="line474"></a> */
<a name="line475"></a>goog.graphics.ext.Element.prototype.setPosition = function(left, top,
<a name="line476"></a>                                                           opt_chain) {
<a name="line477"></a>  this.setLeft(left, true);
<a name="line478"></a>  this.setTop(top, opt_chain);
<a name="line479"></a>};
<a name="line480"></a>
<a name="line481"></a>
<a name="line482"></a>/**
<a name="line483"></a> * Shortcut for setting the width and height.
<a name="line484"></a> * @param {string|number} width The new width value.
<a name="line485"></a> * @param {string|number} height The new height value.
<a name="line486"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line487"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line488"></a> *     pending but not yet performed.
<a name="line489"></a> */
<a name="line490"></a>goog.graphics.ext.Element.prototype.setSize = function(width, height,
<a name="line491"></a>                                                       opt_chain) {
<a name="line492"></a>  this.setWidth(width, true);
<a name="line493"></a>  this.setHeight(height, opt_chain);
<a name="line494"></a>};
<a name="line495"></a>
<a name="line496"></a>
<a name="line497"></a>/**
<a name="line498"></a> * Shortcut for setting the left, top, width, and height.
<a name="line499"></a> * @param {string|number} left The left coordinate.
<a name="line500"></a> * @param {string|number} top The top coordinate.
<a name="line501"></a> * @param {string|number} width The new width value.
<a name="line502"></a> * @param {string|number} height The new height value.
<a name="line503"></a> * @param {boolean=} opt_chain Optional flag to specify this function is part
<a name="line504"></a> *     of a chain of calls and therefore transformations should be set as
<a name="line505"></a> *     pending but not yet performed.
<a name="line506"></a> */
<a name="line507"></a>goog.graphics.ext.Element.prototype.setBounds = function(left, top, width,
<a name="line508"></a>                                                         height, opt_chain) {
<a name="line509"></a>  this.setLeft(left, true);
<a name="line510"></a>  this.setTop(top, true);
<a name="line511"></a>  this.setWidth(width, true);
<a name="line512"></a>  this.setHeight(height, opt_chain);
<a name="line513"></a>};
<a name="line514"></a>
<a name="line515"></a>
<a name="line516"></a>// MAXIMUM BOUNDS
<a name="line517"></a>
<a name="line518"></a>
<a name="line519"></a>/**
<a name="line520"></a> * @return {number} An estimate of the maximum x extent this element would have
<a name="line521"></a> *     in a parent of no width.
<a name="line522"></a> */
<a name="line523"></a>goog.graphics.ext.Element.prototype.getMaxX = function() {
<a name="line524"></a>  return this.xPosition_.getMaxPosition();
<a name="line525"></a>};
<a name="line526"></a>
<a name="line527"></a>
<a name="line528"></a>/**
<a name="line529"></a> * @return {number} An estimate of the maximum y extent this element would have
<a name="line530"></a> *     in a parent of no height.
<a name="line531"></a> */
<a name="line532"></a>goog.graphics.ext.Element.prototype.getMaxY = function() {
<a name="line533"></a>  return this.yPosition_.getMaxPosition();
<a name="line534"></a>};
<a name="line535"></a>
<a name="line536"></a>
<a name="line537"></a>// RESET
<a name="line538"></a>
<a name="line539"></a>
<a name="line540"></a>/**
<a name="line541"></a> * Reset the element.  This is called when the element changes size, or when
<a name="line542"></a> * the coordinate system changes in a way that would affect pixel based
<a name="line543"></a> * rendering
<a name="line544"></a> */
<a name="line545"></a>goog.graphics.ext.Element.prototype.reset = function() {
<a name="line546"></a>  this.xPosition_.resetCache();
<a name="line547"></a>  this.yPosition_.resetCache();
<a name="line548"></a>
<a name="line549"></a>  this.redraw();
<a name="line550"></a>
<a name="line551"></a>  this.needsTransform_ = true;
<a name="line552"></a>  this.transform();
<a name="line553"></a>};
<a name="line554"></a>
<a name="line555"></a>
<a name="line556"></a>/**
<a name="line557"></a> * Overridable function for subclass specific reset.
<a name="line558"></a> * @protected
<a name="line559"></a> */
<a name="line560"></a>goog.graphics.ext.Element.prototype.redraw = goog.nullFunction;
<a name="line561"></a>
<a name="line562"></a>
<a name="line563"></a>// PARENT DEPENDENCY
<a name="line564"></a>
<a name="line565"></a>
<a name="line566"></a>/**
<a name="line567"></a> * Computes whether the element is still parent dependent.
<a name="line568"></a> * @param {goog.graphics.ext.Element.Position_} position The recently changed
<a name="line569"></a> *     position object.
<a name="line570"></a> * @private
<a name="line571"></a> */
<a name="line572"></a>goog.graphics.ext.Element.prototype.computeIsParentDependent_ = function(
<a name="line573"></a>    position) {
<a name="line574"></a>  this.parentDependent_ = position.isParentDependent() ||
<a name="line575"></a>      this.xPosition_.isParentDependent() ||
<a name="line576"></a>      this.yPosition_.isParentDependent() ||
<a name="line577"></a>      this.checkParentDependent();
<a name="line578"></a>};
<a name="line579"></a>
<a name="line580"></a>
<a name="line581"></a>/**
<a name="line582"></a> * Returns whether this element&#39;s bounds depend on its parents.
<a name="line583"></a> *
<a name="line584"></a> * This function should be treated as if it has package scope.
<a name="line585"></a> * @return {boolean} Whether this element&#39;s bounds depend on its parents.
<a name="line586"></a> */
<a name="line587"></a>goog.graphics.ext.Element.prototype.isParentDependent = function() {
<a name="line588"></a>  return this.parentDependent_;
<a name="line589"></a>};
<a name="line590"></a>
<a name="line591"></a>
<a name="line592"></a>/**
<a name="line593"></a> * Overridable function for subclass specific parent dependency.
<a name="line594"></a> * @return {boolean} Whether this shape&#39;s bounds depends on its parent&#39;s.
<a name="line595"></a> * @protected
<a name="line596"></a> */
<a name="line597"></a>goog.graphics.ext.Element.prototype.checkParentDependent =
<a name="line598"></a>    goog.functions.FALSE;
<a name="line599"></a>
<a name="line600"></a>
<a name="line601"></a>// ROTATION
<a name="line602"></a>
<a name="line603"></a>
<a name="line604"></a>/**
<a name="line605"></a> * Set the rotation of this element.
<a name="line606"></a> * @param {number} angle The angle of rotation, in degrees.
<a name="line607"></a> */
<a name="line608"></a>goog.graphics.ext.Element.prototype.setRotation = function(angle) {
<a name="line609"></a>  if (this.rotation_ != angle) {
<a name="line610"></a>    this.rotation_ = angle;
<a name="line611"></a>
<a name="line612"></a>    this.needsTransform_ = true;
<a name="line613"></a>    this.transform();
<a name="line614"></a>  }
<a name="line615"></a>};
<a name="line616"></a>
<a name="line617"></a>
<a name="line618"></a>/**
<a name="line619"></a> * @return {number} The angle of rotation of this element, in degrees.
<a name="line620"></a> */
<a name="line621"></a>goog.graphics.ext.Element.prototype.getRotation = function() {
<a name="line622"></a>  return this.rotation_;
<a name="line623"></a>};
<a name="line624"></a>
<a name="line625"></a>
<a name="line626"></a>// TRANSFORMS
<a name="line627"></a>
<a name="line628"></a>
<a name="line629"></a>/**
<a name="line630"></a> * Called by the parent when the parent has transformed.
<a name="line631"></a> *
<a name="line632"></a> * Should be treated as package scope.
<a name="line633"></a> */
<a name="line634"></a>goog.graphics.ext.Element.prototype.parentTransform = function() {
<a name="line635"></a>  this.needsTransform_ = this.needsTransform_ || this.parentDependent_;
<a name="line636"></a>};
<a name="line637"></a>
<a name="line638"></a>
<a name="line639"></a>/**
<a name="line640"></a> * @return {boolean} Whether this element has pending transforms.
<a name="line641"></a> */
<a name="line642"></a>goog.graphics.ext.Element.prototype.isPendingTransform = function() {
<a name="line643"></a>  return this.needsTransform_;
<a name="line644"></a>};
<a name="line645"></a>
<a name="line646"></a>
<a name="line647"></a>/**
<a name="line648"></a> * Performs a pending transform.
<a name="line649"></a> * @protected
<a name="line650"></a> */
<a name="line651"></a>goog.graphics.ext.Element.prototype.transform = function() {
<a name="line652"></a>  if (this.isPendingTransform()) {
<a name="line653"></a>    this.needsTransform_ = false;
<a name="line654"></a>
<a name="line655"></a>    this.wrapper_.setTransformation(
<a name="line656"></a>        this.getLeft(),
<a name="line657"></a>        this.getTop(),
<a name="line658"></a>        this.rotation_,
<a name="line659"></a>        (this.getWidth() || 1) / 2,
<a name="line660"></a>        (this.getHeight() || 1) / 2);
<a name="line661"></a>
<a name="line662"></a>    // TODO(robbyw): this._fireEvent(&#39;transform&#39;, [ this ]);
<a name="line663"></a>  }
<a name="line664"></a>};
<a name="line665"></a>
<a name="line666"></a>
<a name="line667"></a>// PIXEL SCALE
<a name="line668"></a>
<a name="line669"></a>
<a name="line670"></a>/**
<a name="line671"></a> * @return {number} Returns the number of pixels per unit in the x direction.
<a name="line672"></a> */
<a name="line673"></a>goog.graphics.ext.Element.prototype.getPixelScaleX = function() {
<a name="line674"></a>  return this.getGraphics().getPixelScaleX();
<a name="line675"></a>};
<a name="line676"></a>
<a name="line677"></a>
<a name="line678"></a>/**
<a name="line679"></a> * @return {number} Returns the number of pixels per unit in the y direction.
<a name="line680"></a> */
<a name="line681"></a>goog.graphics.ext.Element.prototype.getPixelScaleY = function() {
<a name="line682"></a>  return this.getGraphics().getPixelScaleY();
<a name="line683"></a>};
<a name="line684"></a>
<a name="line685"></a>
<a name="line686"></a>// EVENT HANDLING
<a name="line687"></a>
<a name="line688"></a>
<a name="line689"></a>/** @override */
<a name="line690"></a>goog.graphics.ext.Element.prototype.disposeInternal = function() {
<a name="line691"></a>  goog.graphics.ext.Element.superClass_.disposeInternal.call();
<a name="line692"></a>  this.wrapper_.dispose();
<a name="line693"></a>};
<a name="line694"></a>
<a name="line695"></a>
<a name="line696"></a>// INTERNAL POSITION OBJECT
<a name="line697"></a>
<a name="line698"></a>
<a name="line699"></a>/**
<a name="line700"></a> * Position specification types.  Start corresponds to left/top, middle to
<a name="line701"></a> * center/middle, and end to right/bottom.
<a name="line702"></a> * @enum {number}
<a name="line703"></a> * @private
<a name="line704"></a> */
<a name="line705"></a>goog.graphics.ext.Element.PositionType_ = {
<a name="line706"></a>  START: 0,
<a name="line707"></a>  MIDDLE: 1,
<a name="line708"></a>  END: 2
<a name="line709"></a>};
<a name="line710"></a>
<a name="line711"></a>
<a name="line712"></a>
<a name="line713"></a>/**
<a name="line714"></a> * Manages a position and size, either horizontal or vertical.
<a name="line715"></a> * @param {goog.graphics.ext.Element} element The element the position applies
<a name="line716"></a> *     to.
<a name="line717"></a> * @param {boolean} horizontal Whether the position is horizontal or vertical.
<a name="line718"></a> * @constructor
<a name="line719"></a> * @private
<a name="line720"></a> */
<a name="line721"></a>goog.graphics.ext.Element.Position_ = function(element, horizontal) {
<a name="line722"></a>  this.element_ = element;
<a name="line723"></a>  this.horizontal_ = horizontal;
<a name="line724"></a>};
<a name="line725"></a>
<a name="line726"></a>
<a name="line727"></a>/**
<a name="line728"></a> * @return {Object} The coordinate value computation cache.
<a name="line729"></a> * @private
<a name="line730"></a> */
<a name="line731"></a>goog.graphics.ext.Element.Position_.prototype.getCoordinateCache_ = function() {
<a name="line732"></a>  return this.coordinateCache_ || (this.coordinateCache_ = {});
<a name="line733"></a>};
<a name="line734"></a>
<a name="line735"></a>
<a name="line736"></a>/**
<a name="line737"></a> * @return {number} The size of the parent&#39;s coordinate space.
<a name="line738"></a> * @private
<a name="line739"></a> */
<a name="line740"></a>goog.graphics.ext.Element.Position_.prototype.getParentSize_ = function() {
<a name="line741"></a>  var parent = this.element_.getParent();
<a name="line742"></a>  return this.horizontal_ ?
<a name="line743"></a>      parent.getCoordinateWidth() :
<a name="line744"></a>      parent.getCoordinateHeight();
<a name="line745"></a>};
<a name="line746"></a>
<a name="line747"></a>
<a name="line748"></a>/**
<a name="line749"></a> * @return {number} The minimum width/height of the element.
<a name="line750"></a> */
<a name="line751"></a>goog.graphics.ext.Element.Position_.prototype.getMinSize = function() {
<a name="line752"></a>  return this.getValue_(this.minSize_);
<a name="line753"></a>};
<a name="line754"></a>
<a name="line755"></a>
<a name="line756"></a>/**
<a name="line757"></a> * Sets the minimum width/height of the element.
<a name="line758"></a> * @param {string|number} minSize The minimum width/height of the element.
<a name="line759"></a> */
<a name="line760"></a>goog.graphics.ext.Element.Position_.prototype.setMinSize = function(minSize) {
<a name="line761"></a>  this.minSize_ = minSize;
<a name="line762"></a>  this.resetCache();
<a name="line763"></a>};
<a name="line764"></a>
<a name="line765"></a>
<a name="line766"></a>/**
<a name="line767"></a> * @return {number} The width/height of the element.
<a name="line768"></a> */
<a name="line769"></a>goog.graphics.ext.Element.Position_.prototype.getSize = function() {
<a name="line770"></a>  return Math.max(this.getValue_(this.size_), this.getMinSize());
<a name="line771"></a>};
<a name="line772"></a>
<a name="line773"></a>
<a name="line774"></a>/**
<a name="line775"></a> * Sets the width/height of the element.
<a name="line776"></a> * @param {string|number} size The width/height of the element.
<a name="line777"></a> * @return {boolean} Whether the value was changed.
<a name="line778"></a> */
<a name="line779"></a>goog.graphics.ext.Element.Position_.prototype.setSize = function(size) {
<a name="line780"></a>  if (size != this.size_) {
<a name="line781"></a>    this.size_ = size;
<a name="line782"></a>    this.resetCache();
<a name="line783"></a>    return true;
<a name="line784"></a>  }
<a name="line785"></a>  return false;
<a name="line786"></a>};
<a name="line787"></a>
<a name="line788"></a>
<a name="line789"></a>/**
<a name="line790"></a> * Converts the given x coordinate to a number value in units.
<a name="line791"></a> * @param {string|number} v The coordinate to retrieve the value for.
<a name="line792"></a> * @param {boolean=} opt_forMaximum Whether we are computing the largest value
<a name="line793"></a> *     this coordinate would be in a parent of no size.
<a name="line794"></a> * @return {number} The correct number of coordinate space units.
<a name="line795"></a> * @private
<a name="line796"></a> */
<a name="line797"></a>goog.graphics.ext.Element.Position_.prototype.getValue_ = function(v,
<a name="line798"></a>    opt_forMaximum) {
<a name="line799"></a>  if (!goog.graphics.ext.coordinates.isSpecial(v)) {
<a name="line800"></a>    return parseFloat(String(v));
<a name="line801"></a>  }
<a name="line802"></a>
<a name="line803"></a>  var cache = this.getCoordinateCache_();
<a name="line804"></a>  var scale = this.horizontal_ ?
<a name="line805"></a>      this.element_.getPixelScaleX() :
<a name="line806"></a>      this.element_.getPixelScaleY();
<a name="line807"></a>
<a name="line808"></a>  var containerSize;
<a name="line809"></a>  if (opt_forMaximum) {
<a name="line810"></a>    containerSize = goog.graphics.ext.coordinates.computeValue(
<a name="line811"></a>        this.size_ || 0, 0, scale);
<a name="line812"></a>  } else {
<a name="line813"></a>    var parent = this.element_.getParent();
<a name="line814"></a>    containerSize = this.horizontal_ ? parent.getWidth() : parent.getHeight();
<a name="line815"></a>  }
<a name="line816"></a>
<a name="line817"></a>  return goog.graphics.ext.coordinates.getValue(v, opt_forMaximum,
<a name="line818"></a>      containerSize, scale, cache);
<a name="line819"></a>};
<a name="line820"></a>
<a name="line821"></a>
<a name="line822"></a>/**
<a name="line823"></a> * @return {number} The distance from the left/top edge of this element to the
<a name="line824"></a> *     left/top edge of its parent, specified in units of the parent&#39;s
<a name="line825"></a> *     coordinate system.
<a name="line826"></a> */
<a name="line827"></a>goog.graphics.ext.Element.Position_.prototype.getStart = function() {
<a name="line828"></a>  if (this.cachedValue_ == null) {
<a name="line829"></a>    var value = this.getValue_(this.distance_);
<a name="line830"></a>    if (this.distanceType_ == goog.graphics.ext.Element.PositionType_.START) {
<a name="line831"></a>      this.cachedValue_ = value;
<a name="line832"></a>    } else if (this.distanceType_ ==
<a name="line833"></a>               goog.graphics.ext.Element.PositionType_.MIDDLE) {
<a name="line834"></a>      this.cachedValue_ = value + (this.getParentSize_() - this.getSize()) / 2;
<a name="line835"></a>    } else {
<a name="line836"></a>      this.cachedValue_ = this.getParentSize_() - value - this.getSize();
<a name="line837"></a>    }
<a name="line838"></a>  }
<a name="line839"></a>
<a name="line840"></a>  return this.cachedValue_;
<a name="line841"></a>};
<a name="line842"></a>
<a name="line843"></a>
<a name="line844"></a>/**
<a name="line845"></a> * @return {number} The middle coordinate of the element, in units of the
<a name="line846"></a> *     parent&#39;s coordinate system.
<a name="line847"></a> */
<a name="line848"></a>goog.graphics.ext.Element.Position_.prototype.getMiddle = function() {
<a name="line849"></a>  return this.distanceType_ == goog.graphics.ext.Element.PositionType_.MIDDLE ?
<a name="line850"></a>      this.getValue_(this.distance_) :
<a name="line851"></a>      (this.getParentSize_() - this.getSize()) / 2 - this.getStart();
<a name="line852"></a>};
<a name="line853"></a>
<a name="line854"></a>
<a name="line855"></a>/**
<a name="line856"></a> * @return {number} The end coordinate of the element, in units of the
<a name="line857"></a> *     parent&#39;s coordinate system.
<a name="line858"></a> */
<a name="line859"></a>goog.graphics.ext.Element.Position_.prototype.getEnd = function() {
<a name="line860"></a>  return this.distanceType_ == goog.graphics.ext.Element.PositionType_.END ?
<a name="line861"></a>      this.getValue_(this.distance_) :
<a name="line862"></a>      this.getParentSize_() - this.getStart() - this.getSize();
<a name="line863"></a>};
<a name="line864"></a>
<a name="line865"></a>
<a name="line866"></a>/**
<a name="line867"></a> * Sets the position, either as a left/top, center/middle, or right/bottom
<a name="line868"></a> * value.
<a name="line869"></a> * @param {number|string} value The value of the coordinate.
<a name="line870"></a> * @param {goog.graphics.ext.Element.PositionType_} type The type of the
<a name="line871"></a> *     coordinate.
<a name="line872"></a> */
<a name="line873"></a>goog.graphics.ext.Element.Position_.prototype.setPosition = function(value,
<a name="line874"></a>    type) {
<a name="line875"></a>  this.distance_ = value;
<a name="line876"></a>  this.distanceType_ = type;
<a name="line877"></a>
<a name="line878"></a>  // Clear cached value.
<a name="line879"></a>  this.cachedValue_ = null;
<a name="line880"></a>};
<a name="line881"></a>
<a name="line882"></a>
<a name="line883"></a>/**
<a name="line884"></a> * @return {number} An estimate of the maximum x/y extent this element would
<a name="line885"></a> *     have in a parent of no width/height.
<a name="line886"></a> */
<a name="line887"></a>goog.graphics.ext.Element.Position_.prototype.getMaxPosition = function() {
<a name="line888"></a>  // TODO(robbyw): Handle transformed or rotated coordinates
<a name="line889"></a>  // TODO(robbyw): Handle pixel based sizes?
<a name="line890"></a>
<a name="line891"></a>  return this.getValue_(this.distance_ || 0) + (
<a name="line892"></a>      goog.graphics.ext.coordinates.isSpecial(this.size_) ? 0 : this.getSize());
<a name="line893"></a>};
<a name="line894"></a>
<a name="line895"></a>
<a name="line896"></a>/**
<a name="line897"></a> * Resets the caches of position values and coordinate values.
<a name="line898"></a> */
<a name="line899"></a>goog.graphics.ext.Element.Position_.prototype.resetCache = function() {
<a name="line900"></a>  this.coordinateCache_ = null;
<a name="line901"></a>  this.cachedValue_ = null;
<a name="line902"></a>};
<a name="line903"></a>
<a name="line904"></a>
<a name="line905"></a>/**
<a name="line906"></a> * @return {boolean} Whether the size or position of this element depends on
<a name="line907"></a> *     the size of the parent element.
<a name="line908"></a> */
<a name="line909"></a>goog.graphics.ext.Element.Position_.prototype.isParentDependent = function() {
<a name="line910"></a>  return this.distanceType_ != goog.graphics.ext.Element.PositionType_.START ||
<a name="line911"></a>      goog.graphics.ext.coordinates.isSpecial(this.size_) ||
<a name="line912"></a>      goog.graphics.ext.coordinates.isSpecial(this.minSize_) ||
<a name="line913"></a>      goog.graphics.ext.coordinates.isSpecial(this.distance_);
<a name="line914"></a>};
<a name="line915"></a>
<a name="line916"></a>
<a name="line917"></a>/**
<a name="line918"></a> * The lazy loaded distance from the parent&#39;s top/left edge to this element&#39;s
<a name="line919"></a> * top/left edge expressed in the parent&#39;s coordinate system.  We cache this
<a name="line920"></a> * because it is most freqeuently requested by the element and it is easy to
<a name="line921"></a> * compute middle and end values from it.
<a name="line922"></a> * @type {?number}
<a name="line923"></a> * @private
<a name="line924"></a> */
<a name="line925"></a>goog.graphics.ext.Element.Position_.prototype.cachedValue_ = null;
<a name="line926"></a>
<a name="line927"></a>
<a name="line928"></a>/**
<a name="line929"></a> * A cache of computed x coordinates.
<a name="line930"></a> * @type {Object}
<a name="line931"></a> * @private
<a name="line932"></a> */
<a name="line933"></a>goog.graphics.ext.Element.Position_.prototype.coordinateCache_ = null;
<a name="line934"></a>
<a name="line935"></a>
<a name="line936"></a>/**
<a name="line937"></a> * The minimum width/height of this element, as specified by the caller.
<a name="line938"></a> * @type {string|number}
<a name="line939"></a> * @private
<a name="line940"></a> */
<a name="line941"></a>goog.graphics.ext.Element.Position_.prototype.minSize_ = 0;
<a name="line942"></a>
<a name="line943"></a>
<a name="line944"></a>/**
<a name="line945"></a> * The width/height of this object, as specified by the caller.
<a name="line946"></a> * @type {string|number}
<a name="line947"></a> * @private
<a name="line948"></a> */
<a name="line949"></a>goog.graphics.ext.Element.Position_.prototype.size_ = 0;
<a name="line950"></a>
<a name="line951"></a>
<a name="line952"></a>/**
<a name="line953"></a> * The coordinate of this object, as specified by the caller.  The type of
<a name="line954"></a> * coordinate is specified by distanceType_.
<a name="line955"></a> * @type {string|number}
<a name="line956"></a> * @private
<a name="line957"></a> */
<a name="line958"></a>goog.graphics.ext.Element.Position_.prototype.distance_ = 0;
<a name="line959"></a>
<a name="line960"></a>
<a name="line961"></a>/**
<a name="line962"></a> * The coordinate type specified by distance_.
<a name="line963"></a> * @type {goog.graphics.ext.Element.PositionType_}
<a name="line964"></a> * @private
<a name="line965"></a> */
<a name="line966"></a>goog.graphics.ext.Element.Position_.prototype.distanceType_ =
<a name="line967"></a>    goog.graphics.ext.Element.PositionType_.START;
</pre>


</body>
</html>
